<template>
  <div>
    <div class="search1">
      <div class="left-input">
        <form>用户名:</form>
        <el-input placeholder="请输入内容" v-model="inputName" clearable></el-input>
        <form>警员编号:</form>
        <el-input placeholder="请输入内容" v-model="inputNumber" clearable></el-input>
      </div>

      <div class="right-button">
        <el-button type="primary" @click="search">搜索</el-button>
      </div>
    </div>

    <div class="search2">
      <el-button type="primary" @click="openDialog">+新增</el-button>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      inputName: "",
      inputNumber: ""
    };
  },
  methods: {
    openDialog() {
      this.$emit("parentopendialog");
    },
    search() {
      // this.$emit("searchfun", this.inputName);
      this.$emit("searchfun", this.inputName, this.inputNumber);
    }
  }
};
</script>

<style lang="less" scoped>
.search1 {
  background-color: #fff;
  padding: 30px;
  display: flex;
  justify-content: left;
  .left-input {
    display: flex;
    justify-content: space-around;
    align-items: center;
  }
  .right-button {
    display: flex;
    justify-content: center;
    align-items: center;
  }

  /deep/form {
    width: 175px;
    align-content: center;
  }
  /deep/.el-input__inner {
    width: 160px;
  }
}
.search2 {
  background-color: #fff;

  padding: 15px;
  display: flex;
  justify-content: right;
  margin: 20px 0px 20px 0px;
}
</style>